package spms.data.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import spms.data.entity.Menu;
import spms.data.service.MenuService;

@Controller
public class MenuController {

    @Autowired
    MenuService menuService;

    @RequestMapping("/menu/findAll")
    @ResponseBody
    public Object findAll() throws Exception {
        Object obj = menuService.findAll(Menu.class);
        return obj;
    }

    @RequestMapping("/menu/findPage")
    @ResponseBody
    public Object findPage(Integer pageNum,Integer pageSize) throws Exception {
        return menuService.findPage(pageNum,pageSize,Menu.class);
    }
}
